package homeword.traffic_light;

public class Yellow implements Runnable{

    private Repository repository;

    public Yellow(Repository repository) {
        this.repository = repository;
    }


    @Override
    public void run() {
        while (true){
            try {
                repository.lock.lock();
                this.repository.yellow();
            } catch (Exception e) {
                e.printStackTrace();
            }finally {
                repository.lock.unlock();
            }
        }
    }
}
